package com.jiaomatech.demo.order.feign;

import com.jiaomatech.demo.order.configuration.OrderServiceApiConfiguration;
import com.jiaomatech.demo.order.dto.OrderDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Description: 同步服务API .<br>
 *
 * @author m-xy
 *     Created By 2019/8/5 上午10:12
 */
@FeignClient(
    value = "order-service-demo",
    configuration = OrderServiceApiConfiguration.class,
    path = "/order"
)
public interface OrderSearchFeign {
    /**
     * 查询订单信息.
     *
     * @param orderId
     * @return
     */
    @RequestMapping(value = "/{orderId}", method = RequestMethod.GET,
                    produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseEntity<OrderDto> findOrderById(@PathVariable("orderId") String orderId);
}
